package com.cleaningcloud.cld.controller;

import com.cleaningcloud.cld.service.*;
import com.cleaningcloud.common.core.web.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 云管理定时任务Controller
 *
 * @author cleaningcloud
 * @date 2024-10-07
 */
@RestController
@RequestMapping("/task")
public class CldTaskController extends BaseController {

    @Autowired
    private ICldAssetsDepreciationService cldAssetsDepreciation;

    @Autowired
    private ICldInvoiceService iCldInvoiceService;

    @Autowired
    private ICldStaffService cldStaffService;

    @Autowired
    private ICldCalendarService cldCalendarService;

    @Autowired
    private ICldTaskService taskService;


    /**
     * @Author Shaw
     * @Description 员工离职
     * @date: 2025-06-18 14:00
     * @param: //TODO
     */
    @GetMapping("/staffResignation")
    public void staffResignation() {
        cldStaffService.staffResignation();
    }

    /**
     * @Author Shaw
     * @Description 项目合同到期
     * @date: 2025-06-18 14:01
     * @param: //TODO
     */
    @GetMapping("/projectContractExpiresTask")
    public void projectContractExpiresTask() {
        taskService.projectExpirationTask();
    }

    /**
     * @Author Shaw
     * @Description 资产折旧
     * @date: 2025-06-18 14:01
     * @param: //TODO
     */
    @GetMapping("/calculateAssetsDepreciationTask")
    public void calculateAssetsDepreciationTask() {
        cldAssetsDepreciation.calculateAssetsDepreciationTask();
    }

    /**
     * @Author Shaw
     * @Description 项目发票生成
     * @date: 2025-06-18 14:01
     * @param: //TODO
     */
    @GetMapping("/calculateProjectInvoiceTask")
    public void calculateProjectInvoiceTask() {
        iCldInvoiceService.calculateProjectInvoiceTask();
    }

    /**
     * @Author Shaw
     * @Description 生成日历信息
     * @date: 2025-06-18 14:01
     * @param: //TODO
     */
    @GetMapping("/generateCalendarTask")
    public void generateCalendarTask() {
        cldCalendarService.generateCalendarTask();
    }

    /**
     * @Author Shaw
     * @Description 初始化当日考勤记录
     * @date: 2025-06-18 14:01
     * @param: //TODO
     */
    @GetMapping("/initializeAttendanceTask")
    public void initializeAttendanceTask() {
        taskService.initializeAttendanceTask();
    }

    /**
     * @Author Shaw
     * @Description 工服扣款
     * @Description 保险扣款
     * @Description 招聘薪酬
     * @date: 2025-06-18 14:01
     * @param: //TODO
     */
    @GetMapping("/dailySalaryCalculationTask")
    public void dailySalaryCalculationTask() {
        taskService.monthlyUniformDeductionsTask();
        taskService.recruitmentExpensesSalaryCalculation();
    }

    /**
     * @Author Shaw
     * @Description 招聘计划计算
     * @date: 2025-06-18 14:02
     * @param: //TODO
     */
    @GetMapping("/recruitmentPlanTask")
    public void recruitmentPlanTask() {
        taskService.recruitmentPlanTask();
    }

    /**
     * @Author Shaw
     * @Description 工作计划生成
     * @date: 2025-06-18 14:02
     * @param: //TODO
     */
    @GetMapping("/workPlanTask")
    public void workPlanTask() {
        taskService.workPlanTask();
    }

    /**
     * @Author Shaw
     * @Description 工作计划自动确认
     * @date: 2025-06-18 14:02
     * @param: //TODO
     */
    @GetMapping("/automaticConfirmTask")
    public void automaticConfirmTask() {
        taskService.automaticConfirmTask();
    }

    /**
     * @Author Shaw
     * @Description 绩效考核
     * @date: 2025-06-18 14:02
     * @param: //TODO
     */
    @GetMapping("/performanceAppraisalTask")
    public void performanceAppraisalTask() {
        taskService.performanceAppraisalTask();
    }

    /**
     * @Author Shaw
     * @Description 客户评价
     * @date: 2025-06-18 14:02
     * @param: //TODO
     */
    @GetMapping("/customerEvaluateTask")
    public void customerEvaluateTask() {
        taskService.customerEvaluateTask();
    }
}
